import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsTagsController } from '../../../controllers';
const uctoocmsTagsRouter = new Router();
const cmsTagsController = new uctooCmsTagsController();

uctoocmsTagsRouter.post('/add', requireUser, cmsTagsController.add);
uctoocmsTagsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_tags'), cmsTagsController.edit);
uctoocmsTagsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_tags'), cmsTagsController.delete);

//For getting cmsTags with permission control
uctoocmsTagsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_tags'), cmsTagsController.getSingle);
uctoocmsTagsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_tags'), cmsTagsController.getMany);
uctoocmsTagsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_tags'), cmsTagsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsTagsRouter;
